class RptOrdingsController < ApplicationController
  before_action :set_rpt_ording, only: [:show, :edit, :update, :destroy]

  # GET /rpt_ordings
  # GET /rpt_ordings.json
  def index
    @rpt_ordings = RptOrding.all
  end

  # GET /rpt_ordings/1
  # GET /rpt_ordings/1.json
  def show
  end

  # GET /rpt_ordings/new
  def new
    @rpt_ording = RptOrding.new
  end

  # GET /rpt_ordings/1/edit
  def edit
  end

  # POST /rpt_ordings
  # POST /rpt_ordings.json
  def create
    @rpt_ording = RptOrding.new(rpt_ording_params)

    respond_to do |format|
      if @rpt_ording.save
        format.html { redirect_to @rpt_ording, notice: 'Rpt ording was successfully created.' }
        format.json { render :show, status: :created, location: @rpt_ording }
      else
        format.html { render :new }
        format.json { render json: @rpt_ording.errors, status: :unprocessable_entity }
      end
    end
  end

  # PATCH/PUT /rpt_ordings/1
  # PATCH/PUT /rpt_ordings/1.json
  def update
    respond_to do |format|
      if @rpt_ording.update(rpt_ording_params)
        format.html { redirect_to @rpt_ording, notice: 'Rpt ording was successfully updated.' }
        format.json { render :show, status: :ok, location: @rpt_ording }
      else
        format.html { render :edit }
        format.json { render json: @rpt_ording.errors, status: :unprocessable_entity }
      end
    end
  end

  # DELETE /rpt_ordings/1
  # DELETE /rpt_ordings/1.json
  def destroy
    @rpt_ording.destroy
    respond_to do |format|
      format.html { redirect_to rpt_ordings_url, notice: 'Rpt ording was successfully destroyed.' }
      format.json { head :no_content }
    end
  end

  private
    # Use callbacks to share common setup or constraints between actions.
    def set_rpt_ording
      @rpt_ording = RptOrding.find(params[:id])
    end

    # Never trust parameters from the scary internet, only allow the white list through.
    def rpt_ording_params
      params.require(:rpt_ording).permit(:ording, :user_id)
    end
end
